package com.example.plxnapplication;

import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

public class SuccessActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_success);

        TextView tvAccount = findViewById(R.id.tv_account);
        TextView tvGender = findViewById(R.id.tv_gender);
        TextView tvLocation = findViewById(R.id.tv_location);
        Button btnReturn = findViewById(R.id.btn_return);

        Intent intent = getIntent();
        String username = intent.getStringExtra("username");
        String gender = intent.getStringExtra("gender");
        String location = intent.getStringExtra("location");

        tvAccount.setText("您的账号为：" + username);
        tvGender.setText("您的性别为：" + gender);
        tvLocation.setText("所在校区为：" + location);

        Toast.makeText(this, "注册成功！", Toast.LENGTH_SHORT).show();

        btnReturn.setOnClickListener(v -> finish());
    }

}
